package org.ms.mtx.core.annotation;

import java.lang.annotation.*;

/**
 * The Sub Transactional Annotation
 *
 * @author lry
 */
@Documented
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Transactional {

    /**
     * The transactional name or id
     * <p>
     * The default value is the full path of the current method.
     *
     * @return sub transactional name or id
     */
    String value() default "";

    // =================== confirm、cancel

    /**
     * The confirm
     * <p>
     * The default is xxxConfirm.
     *
     * @return sub transactional confirm key(confirm method name)
     */
    String confirm() default "";

    /**
     * The cancel
     * <p>
     * The default is xxxCancel.
     *
     * @return sub transactional cancel key(cancel method name)
     */
    String cancel() default "";

    // =================== public confirm、cancel bean name or class

    /**
     * The public confirm and cancel bean class
     *
     * @return confirm and cancel class
     */
    Class<?> clazz() default Void.class;

    // =================== custom confirm bean class、cancel bean class

    /**
     * The confirm class
     *
     * @return confirm class
     */
    Class<?> confirmClass() default Void.class;

    /**
     * The cancel class
     *
     * @return cancel class
     */
    Class<?> cancelClass() default Void.class;


}
